{extend name="common/common" /}

{block name="content"}
<el-row>
	<el-col :md="12">
		<div class="ibox-title">
		    <h5>选择报表日期（月报）</h5>
		</div>
		<div class="ibox-content">
			<el-form label-width="120px">
				<el-form-item label="选择报表日期">
					<el-date-picker
						v-model="rptDate"
						type="month" value-format="yyyy年MM月"
						placeholder="选择报表日期">
				    </el-date-picker>
				</el-form-item>
				<el-form-item label=" ">
					<el-button type="primary" @click="write" plain>上报</el-button>
				</el-form-item>
			</el-form>
		</div>
	</el-col>
</el-row>
{/block}

{block name="script"}
<script type="text/javascript">
var main =  new Vue({
	el:"#main",
	data() {
		return {
			loading:false,
			rptDate:"",
			isSaved:'{$isSaved|default=0}'
		}
	},
	mounted:function(){
		if(this.isSaved != 0){
			this.$notify.error({
				title:"错误",
				message:"该月份的报表已经上报"
			});
		}
	},
	methods:{
		write() {
			if(this.rptDate == ''){
				this.$notify.error({
					title:"错误",
					message:"请选择上报日期"
				});
			}else{
				window.location.href = "{:url('Commit/Month')}?rptDate="+this.rptDate;
			}
		}
	}
})
</script>
{/block}
